Skip to content

feat: add a encrypt_secret helper function #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 2, 2025
Merged

Conversation

awalker4
Copy link
Collaborator

Add a users.encrypt_secret that conforms to Unstructured's secret formats. This will allow users to encrypt credentials locally before using them in connector config.

@awalker4 awalker4 requested a review from CyMule July 1, 2025 19:59
@awalker4 awalker4 enabled auto-merge (squash) July 1, 2025 20:42
# Use the length of the public key to determine the encryption type
key_size_bytes = public_key.key_size // 8
max_rsa_length = key_size_bytes - 66 # OAEP SHA256 overhead
print(max_rsa_length)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(max_rsa_length)

nit

"""
_, public_key_pem = rsa_key_pair

print(f"Testing plaintext of length {len(plaintext)} with expected type {secret_type}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(f"Testing plaintext of length {len(plaintext)} with expected type {secret_type}")

nit

@awalker4 awalker4 merged commit c8ad850 into main Jul 2, 2025
36 of 39 checks passed
@awalker4 awalker4 deleted the feat/secret-encryption branch July 2, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants